<%--
  Created by IntelliJ IDEA.
  User: cyy
  Date: 2020/3/7
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String business=request.getSession().getAttribute("business")+"";
%>
<c:set var="ctx" value="<%=basePath%>"  />
<c:set var="business" value="<%=business%>"  />
<html>
<head>
    <title>商家管理系统</title>

    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css" />
    <link href="/static/bootstrap/css/bootstrapValidator.min.css"  rel="stylesheet"/>
    <link rel="stylesheet" href="/static/toastr/toastr.min.css">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
    <script  src="/static/bootstrap/js/bootstrapValidator.js"></script>
    <script src="/static/toastr/toastr.min.js"></script>
    <script src="/static/js/business/login.js"></script>
    <style type="text/css">
        .navbar{
            background-color: #DEB887;
        }
        /*更改左侧栏高度 颜色 大小*/
        a.list-group-item{
            color: #821f1f;
            height: 80px;
            font-size: 15px;
        }
        .list-group-item {
            padding: 25px 20px;
        }
        /*更改背景颜色*/
        a.list-group-item:hover{
            background-color: #FAF0E6;
        }
    </style>
    <script type="application/javascript">
        var ctx= '${ctx}';
        var business='${business}'
        console.info(""+ctx+"--商家信息:"+business)
    </script>
</head>
<body>
<nav class="navbar " role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">
                <img src="/static/img/logoNew.png" width="100px" height="45px" style="margin-top: -10px" />
            </a>
        </div>
        <div class="collapse navbar-collapse" id="example-navbar-collapse">
            <ul class="nav navbar-nav">
                <li>
                    <span class="navbar-brand">商家入驻系统</span>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <c:choose>
                    <c:when test="${business == 'null'}">
                    <li>
                        <%--<a href="${ctx}business/login">登录</a>--%>
                            <a data-toggle="modal" data-target="#loginModal">登录</a>
                    </li>
                    <li>
                        <a href="${ctx}business/register">注册</a>
                    </li>
                    </c:when>
                    <c:otherwise>
                        <li>
                            <a>欢迎[${business}]登录</a>
                        </li>
                        <li>
                            <a href="update">修改信息</a>
                        </li>
                        <li>
                            <a href = "${ctx}business/blogout">退出</a>
                        </li>
                    </c:otherwise>
                </c:choose>
                <li>
                    <a href = "${ctx}home">酒店首页</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <!--左边菜单栏-->
        <div class="col-sm-2" id="userMenu" style="height: 500px;">
            <a href="${ctx}business/uploadInfo" class="list-group-item" target="businessFrame" >
                         <span class="glyphicon glyphicon-pencil" aria-hidden="true">
                         </span>酒店信息录入</a>
            <a href="${ctx}business/uploadInfoEdit" class="list-group-item" target="businessFrame">
                        <span class="glyphicon glyphicon-align-left" aria-hidden="true">
                        </span>信息查看/更改</a>
            <a href="${ctx}business/business_bookorder" target="businessFrame" class="list-group-item">
                        <span class="glyphicon glyphicon-th-list" aria-hidden="true">
                        </span>酒店订单查看</a>
            <a href="${ctx}business/business_review" target="businessFrame" class="list-group-item">
                        <span class="glyphicon glyphicon-th-list" aria-hidden="true">
                        </span>酒店评论查看</a>
            <a href="${ctx}business/business_totalInPrice" target="businessFrame" class="list-group-item">
                        <span class="glyphicon glyphicon-yen" aria-hidden="true">
                        </span>酒店收入展示</a>
        </div>
        <!--右边内容   scrolling：滚动条-->
        <div class="col-sm-10" style="height: 510px;" id="content">
            <iframe  src="business_logo"  id="businessFrame" name="businessFrame"
                    scrolling="auto"  frameborder="0" width="100%"  height="100%" frameBorder="0">
            </iframe>
        </div>
        <!-- 底部页脚部分 -->
        <div class="footer">
            <p class="text-center">
                2020&copy; 桃子大帅比
            </p>
        </div>
    </div>
</div>

<%--登录模态框--%>
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="scanInfoModalLabel">登录框</h4>
            </div>
            <form class="form-horizontal center-block" role="form" id="login">
                <div class="modal-body" >
                        <div class="form-group">
                            <label class="col-md-4 control-label"  style="padding-top: 0px"><img style="width: 34px;height: 34px" src="/static/img/register/user.png" />用户:</label>
                            <div class="col-md-4">
                                <input class="form-control" id="brealname"  name="brealname" type="text" placeholder="会员手机号"  autocomplete="off"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-4 control-label" style="padding-top: 0px"><img style="width: 34px;height: 34px" src="/static/img/register/password.png" />密码:</label>
                            <div class="col-md-4">
                                <input class="form-control" id="bpassword" name="bpassword"  type="password" placeholder="请输入密码" autocomplete="off"/>
                            </div>
                        </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" style="margin-left: 2px; width: 100px" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" style="margin-left: 2px; width: 100px" id="loginActive">登录</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
